package cn.platform.mapper;

import cn.platform.entity.SchAnnounce;
import cn.platform.response.SchAnnounceVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface SchAnnounceMapper {
    // 新增
    void insertSchAnnounce(SchAnnounce announcement);

    // 更新，用id找，其余参数为更新内容，null值不更新
    void updateSchAnnounce(SchAnnounce schAnnounce);


    /**
     * 实现条件分页查询
     * @param map
     * @return
     * @author oyq
     */
    Page<SchAnnounceVO> pageQuery(Map<String,Object> map);

    /**
     * 根据id查询通知
     * @param id
     * @return
     * @author oyq
     */
    @Select("select * from jxt_sch_announcements where id=#{id}")
    SchAnnounce getById(Integer id);

    /**
     * 根据id删除单条记录
     * @param id
     */
    @Delete("delete from jxt_sch_announcements where id=#{id}")
    void deleteById(Integer id);

    /**
     * 根据id批量删除记录
     * @param ids
     */
    void deleteBatch(List<Integer> ids);
}
